Learn R Programming

VeryLargeIntegers (version 0.1.8)

16. Jacobi Symbol: Computation of the Jacobi Symbol for vli Objects

Description

Computation of the Jacobi Symbol for vli (Very Large Integers) objects. The Jacobi Symbol is a generalization of the Legendre Symbol, not being necessary that n be a prime number.

It is needed in many algorithms of modular arithmetic, computational number theory and cryptography. For example, it is used by the present package in the Solovay-Strassen probabilistic primality test.

Usage

Jacobi(a, n)

# S3 method for default Jacobi(a, n)

# S3 method for numeric Jacobi(a, n)

# S3 method for vli Jacobi(a, n)

Value

object of class vli with value -1, 0 or 1.

Arguments

a

object of class vli or 32 bits integer

n

positive odd integer; object of class vli or 32 bits integer

Author

Javier Leiva Cuadrado

Examples

Run this code
x <- as.vli("342635653456")
y <- as.vli("3210591001")
Jacobi(x, y)

Run the code above in your browser using DataLab